package com.itheima.Text;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Text01 {
    public static void main(String[] args) {

        //实现n个学生的随机点名
        //利用collections工具类实现集合批量添加数据和

        ArrayList<String> list=new ArrayList<>();
        Collections.addAll(list,"范闲","范建","范统","杜子腾","杜琦燕","宋合泛","侯笼藤","朱益群","朱穆朗玛峰","袁明媛");
        //随机点名
        Random r=new Random();
        int i = r.nextInt(list.size());
        String s = list.get(i);
        System.out.println(s);

        Collections.shuffle(list);
        String s1 = list.get(0);
        System.out.println(s1);

    }
}
